cmake_minimum_required(VERSION 3.0.0)
project(voice_assistant VERSION 0.1.0 LANGUAGES C)

# add_library(record STATIC record.c)

# add_library(control STATIC control.c)

add_executable(voice_assistant main.c)




add_executable(key key.c record.c control.c token.c http.c config.c tts.c play.c jrsc.c chat.c)
target_compile_definitions(key PRIVATE _GNU_SOURCE)
target_link_libraries(key gpiod asound cjson curl uuid resolv)

add_subdirectory(snowboy)


add_executable(wake wake.c record.c stt.c token.c http.c config.c tts.c play.c jrsc.c)
target_link_libraries(wake snowboy-wrapper snowboy-detect cblas m stdc++ asound curl cjson resolv uuid)
target_compile_definitions(wake PRIVATE _GNU_SOURCE)


# add_executable(jrsc jrsc.c)
# target_link_libraries(jrsc cjson curl)

# add_executable(chat chat.c config.c http.c)
# target_link_libraries(chat cjson curl)
# target_compile_definitions(chat PRIVATE _GNU_SOURCE)

add_executable(utils utils.c)
target_link_libraries(utils uuid resolv)

# add_executable(tts tts.c config.c http.c play.c)
# target_link_libraries(tts cjson curl uuid resolv asound)
# target_compile_definitions(tts PRIVATE _GNU_SOURCE)